// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()
const db = cloud.database()
const getCardsCollection = db.collection('getcards')
// 云函数入口函数
exports.main = async (event, context) => {
  try {
    return await getCardsCollection.add({
      // data 字段表示需新增的 JSON 数据
      data: {
        number: event.number,
        name: event.name,
        telephone: event.telephone,
        category:false
      }
    })
  } catch (e) {
    console.error(e)
  }
}